1 function StringFormat(a) { for (var b = 1; b < arguments.length; b++) a = a.replace("{" + (b - 1) + "}", arguments[b]); return a } function GetLocation(a) { var b = null; b = "object" != typeof a ? document.getElementById(a) : a; for (var c = 0, d = 0; b;) c += b.offsetLeft, d += b.offsetTop, b = b.offsetParent; return [c, d] } function PopupPage(a, b, c) { document.body.offsetHeight, document.body.offsetWidth, window.open(a, "", "width=" + b + ",height=" + c + ",resizable=1,scrollbars=yes,location=0") } function PopupPageWithMenuBar(a, b, c) { document.body.offsetHeight, document.body.offsetWidth, window.open(a, "", "width=" + b + ",height=" + c + ",resizable=1,scrollbars=yes,location=0, menubar=1") } function OpenFancyBox(a) { $.fancybox.open([{ type: "iframe", href: a }], { closeBtn: !1, width: "90%", height: "100%", minWidth: "800", minHeight: "100%", margin: 5, padding: 5 }) } function OpenFancyBoxSize(a, b, c) { $.fancybox.open([{ type: "iframe", href: a }], { closeBtn: !1, width: b, height: c, minHeight: c, margin: 5, padding: 5 }) } function OpenFancyBoxHaveCloseButton(a) { $.fancybox.open([{ type: "iframe", href: a }], { width: "850", height: "600", minWidth: "800", margin: 5, padding: 5 }) } function LoginAgainAdmin() { window.location.href = "Default.aspx" } function SetGuidePage(a) { var b = document.getElementById("aGuide"); if (null != b) { var c = "800", d = "450"; b.href = "javascript:PopupPage('" + a + "', " + c + ", " + d + ");" } else alert("'aGuide' kh\xf4ng t\xecm th\u1ea5y.") } function CheckEditData() { var a = !0, b = GirdViewGetSelectedRow(); return 0 == b.length ? (alert(AlertNoneSelect), a = !1) : b.length > 1 && (alert(AlertMultipleSelect), a = !1), a } function CheckDeleteData() { var a = !0, b = GirdViewGetSelectedRow(); return 0 == b.length ? (alert(AlertNoneSelect), a = !1) : 0 == confirm(ConfirmDelete) && (a = !1), a } function DisableSaveData(a) { var b = null; b = "string" == typeof a ? document.getElementById(a) : a, b.style.display = "none" } function EnableDisableControl(a, b) { for (var c = null, d = 0; d < a.length; d++) c = a[d], "string" == typeof c && (c = document.getElementById(c)), c.style.display = b ? "" : "none" } function GetVisibleIcon(a) { return a ? ["VisibleSmall.gif", Visible] : ["InvisibleSmall.gif", Invisible] } function OpenDictionary() { PopupPage("Dictionary.aspx", 810, 300) } function PriceFormat(a) { var b = ""; a += ""; var c = a.indexOf("."); -1 != c ? b = "," + a.substring(c + 1, a.length) : c = a.length; for (var d = c - 1, e = 0; d >= 0; d--, e++) b = a.charAt(d) + (e % 3 == 0 && 0 != e ? "." : "") + b; return b } function CompareDate(a, b) { var c = 0, d = a.split("-"), e = b.split("-"); return c = CompareNumber(d[2], e[2]), 0 != c ? c : (c = CompareNumber(d[1], e[1]), 0 != c ? c : c = CompareNumber(d[0], e[0])) } function CompareNumber(a, b) { return a = parseFloat(a), b = parseFloat(b), a > b ? 1 : a < b ? -1 : 0 } function IsEmail(a) { var b = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$/, c = b.test(a); return c } function IsUserName(a) { var b = /^[a-zA-Z0-9.-]+$/; return b.test(a) } function AddMonths(a, b) { var c = a.split("-"); if (3 == c.length) { var g, d = parseInt(c[0], 10), e = parseInt(c[1], 10), f = parseInt(c[2], 10), h = new Date(f, e - 1, d); return h.setMonth(h.getMonth() + b), g = h.getDate() < 10 ? "0" + h.getDate() : h.getDate(), g += h.getMonth() < 9 ? "-0" + (h.getMonth() + 1) : "-" + (h.getMonth() + 1), g + "-" + h.getFullYear() } return "" } function IsValidDateTime(a, b) { var c = !0, d = a.value.split("-"); if (3 == d.length) { var e = parseInt(d[0], 10), f = parseInt(d[1], 10), g = parseInt(d[2], 10), h = new Date(g, f - 1, e); h && h.getMonth() + 1 == f && h.getDate() == e ? c = !0 : (c = !1, alert(b + " kh\xf4ng h\u1ee3p l\u1ec7."), a.focus()) } else c = !1, alert(b + " kh\xf4ng h\u1ee3p l\u1ec7."), a.focus(); return c } function IsValidDate(a, b, c, d) { var e = !0; return 0 == a.value.length || isNaN(a.value) || a.value <= 0 ? (e = !1, alert(d + " kh\xf4ng h\u1ee3p l\u1ec7. (Ng\xe0y ph\u1ea3i l\xe0 con s\u1ed1 > 0)"), a.focus()) : 0 == b.value.length || isNaN(b.value) || b.value <= 0 || b.value > 12 ? (e = !1, alert(d + " kh\xf4ng h\u1ee3p l\u1ec7. (Th\xe1ng ph\u1ea3i l\xe0 con s\u1ed1 t\u1eeb 1 -> 12)"), b.focus()) : 0 == c.value.length || isNaN(c.value) || c.value <= 0 ? (e = !1, alert(d + " kh\xf4ng h\u1ee3p l\u1ec7. (N\u0103m ph\u1ea3i l\xe0 con s\u1ed1 > 0)"), c.focus()) : a.value > GetMaxDay(b.value, c.value) && (e = !1, alert(d + " kh\xf4ng h\u1ee3p l\u1ec7. (Ng\xe0y ph\u1ea3i l\xe0 con s\u1ed1 t\u1eeb 1 -> " + GetMaxDay(b.value, c.value) + ")"), a.focus()), e } function GetMaxDay(a, b) { return 2 == a && (b % 400 == 0 || b % 100 != 0 && b % 4 == 0) ? 29 : 1 == a || 3 == a || 7 == a || 5 == a || 8 == a || 10 == a || 12 == a ? 31 : 4 == a || 6 == a || 9 == a || 11 == a ? 30 : 28 } function FormatNumber(obj) { var strvalue = ""; strvalue = eval(obj) ? eval(obj).value : obj; var num; num = strvalue.toString().replace(/\$|\,/g, ""), isNaN(num) && (num = ""), sign = num == (num = Math.abs(num)), num = Math.floor(100 * num + .50000000001), num = Math.floor(num / 100).toString(); for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3) ; i++) num = num.substring(0, num.length - (4 * i + 3)) + "," + num.substring(num.length - (4 * i + 3)); eval(obj).value = (sign ? "" : "-") + num } function GetFormatNumber(a) { var b; b = a.toString().replace(/\$|\,/g, ""), isNaN(b) && (b = ""), sign = b == (b = Math.abs(b)), b = Math.floor(100 * b + .50000000001), b = Math.floor(b / 100).toString(); for (var c = 0; c < Math.floor((b.length - (1 + c)) / 3) ; c++) b = b.substring(0, b.length - (4 * c + 3)) + "," + b.substring(b.length - (4 * c + 3)); return (sign ? "" : "-") + b } function navigateWithReferrer(a) { var b = document.createElement("a"); "undefined" == typeof b.click ? location.href = a : (b.href = a, document.body.appendChild(b), b.click()) } function LoaiBoTiengViet(a) { return a = a.toLowerCase(), a = a.replace(/\xe0|\xe1|\u1ea1|\u1ea3|\xe3|\xe2|\u1ea7|\u1ea5|\u1ead|\u1ea9|\u1eab|\u0103|\u1eb1|\u1eaf|\u1eb7|\u1eb3|\u1eb5/g, "a"), a = a.replace(/\xe8|\xe9|\u1eb9|\u1ebb|\u1ebd|\xea|\u1ec1|\u1ebf|\u1ec7|\u1ec3|\u1ec5/g, "e"), a = a.replace(/\xec|\xed|\u1ecb|\u1ec9|\u0129/g, "i"), a = a.replace(/\xf2|\xf3|\u1ecd|\u1ecf|\xf5|\xf4|\u1ed3|\u1ed1|\u1ed9|\u1ed5|\u1ed7|\u01a1|\u1edd|\u1edb|\u1ee3|\u1edf|\u1ee1/g, "o"), a = a.replace(/\xf9|\xfa|\u1ee5|\u1ee7|\u0169|\u01b0|\u1eeb|\u1ee9|\u1ef1|\u1eed|\u1eef/g, "u"), a = a.replace(/\u1ef3|\xfd|\u1ef5|\u1ef7|\u1ef9/g, "y"), a = a.replace(/\u0111/g, "d"), a = a.replace(/[\s]+/g, " "), a = a.replace(/^\s+|\s+$/g, "") } String.prototype.Format = function () { for (var a = this, b = 0; b < arguments.length; b++) a = a.replace("{" + b + "}", arguments[b]); return a }, String.format = function () { for (var a = arguments[0], b = 0; b < arguments.length - 1; b++) { var c = new RegExp("\\{" + b + "\\}", "gm"); a = a.replace(c, arguments[b + 1]) } return a }, String.prototype.Trim = function () { return this.replace(/^\s+|\s+$/g, "") }, String.prototype.LTrim = function () { return this.replace(/^\s+/, "") }, String.prototype.RTrim = function () { return this.replace(/\s+$/, "") };



Full source code website bán hàng thương mại điện tử gần giống shopee 472.185 lượt xem

Gõ tìm kiếm nhanh...